<template>
  <div class="detalis_container">
    <div class="details_title">
      <h4>{{title}}</h4>
      <p class="time">{{time}}</p>
    </div>
    <div class="details" v-html="content">{{content}}> </div>
  </div>
</template>
<style scoped>
.details >>> img {
  width: 100% !important;
  height: auto !important;
}
</style>
<script>
import path from '@/network'
export default {
  name: 'App',
  data () {
    return {
      secondId: this.$route.query.secondId,
      type: this.$route.query.type,
      count: 0,
      title: '',
      time: '',
      source: '',
      content: '',

    };
  },

  mounted () {
    if (this.type == 1) {
      this.getLiveDetails(this.$route.query.secondId);
    } else if (this.type == 2) {
      this.getlawDetails(this.$route.query.secondId);

    } else {
      this.getRuleDetails(this.$route.query.secondId);
    }

  },
  methods: {
    //获取list
    getLiveDetails (id) {
      path.getLiveDetails(
        id
      ).then(res => {
        if (res.success === 0) {
          this.title = res.rows.title
          this.time = res.rows.createTime
          this.source = res.rows.profiles
          this.content = res.rows.content
        }

      })
    },

    //获取list
    getlawDetails (id) {
      path.getlawDetails(
        id
      ).then(res => {
        if (res.success === 0) {
          this.title = res.rows.title
          this.time = res.rows.createTime
          this.source = res.rows.profiles
          this.content = res.rows.content
        }

      })
    },
    getRuleDetails (id) {
      path.getRuleDetails(
        id
      ).then(res => {
        if (res.success === 0) {
          this.title = res.rows.title
          this.time = res.rows.createTime
          this.source = res.rows.profiles
          this.content = res.rows.content
        }

      })
    },

  }
}
</script>